package com.example.lib_base.room

import androidx.room.Dao
import androidx.room.Delete
import androidx.room.Insert
import androidx.room.OnConflictStrategy
import androidx.room.Query

@Dao
interface HistoryDao {
    //新增历史记录
    @Insert(onConflict = OnConflictStrategy.REPLACE)
    fun insert(historyEntity: HistoryEntity)
    //查询历史记录
    @Query("select * from history")
    fun query():MutableList<HistoryEntity>
    //删除单个历史记录
    @Delete
    fun delete(historyEntity: HistoryEntity)
    //清空历史记录
    @Query("delete from history")
    fun deleteAll()
}